<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable dir="ltr">|אבד דעפ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אבד דעפ <span>abc def</span>ווש כטז</div>',
  '14-0 left word');

selection_test(
  '<div contenteditable dir="ltr">א|בד דעפ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-1 left word');

selection_test(
  '<div contenteditable dir="ltr">אב|ד דעפ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-2 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד| דעפ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אבד דעפ <span>abc def</span>ווש כטז</div>',
  '14-3 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד |דעפ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">|אבד דעפ <span>abc def</span>ווש כטז</div>',
  '14-4 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד ד|עפ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 |\u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-5 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דע|פ <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 |\u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-6 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ| <span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 |\u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-7 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ |<span>abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 |\u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-8 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>|abc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 |\u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-9 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>a|bc def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ |<span>abc def</span>ווש כטז</div>',
  '14-10 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>ab|c def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ |<span>abc def</span>ווש כטז</div>',
  '14-11 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc| def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ |<span>abc def</span>ווש כטז</div>',
  '14-12 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ |<span>abc def</span>ווש כטז</div>',
  '14-13 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc d|ef</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  '14-14 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc de|f</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  '14-15 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def|</span>ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  '14-16 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>|ווש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  '14-17 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>ו|וש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc |def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-18 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>וו|ש כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc |def</span>\u05D5\u05D5\u05E9 \u05DB\u05D8\u05D6</div>',
  '14-19 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>ווש| כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  '14-20 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>ווש |כטז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">אבד דעפ <span>abc |def</span>ווש כטז</div>',
  '14-21 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>ווש כ|טז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 |\u05DB\u05D8\u05D6</div>',
  '14-22 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>ווש כט|ז</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 |\u05DB\u05D8\u05D6</div>',
  '14-23 left word');

selection_test(
  '<div contenteditable dir="ltr">אבד דעפ <span>abc def</span>ווש כטז|</div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable dir="ltr">\u05D0\u05D1\u05D3 \u05D3\u05E2\u05E4 <span>abc def</span>\u05D5\u05D5\u05E9 |\u05DB\u05D8\u05D6</div>',
  '14-24 left word');
</script>
